package cn.wolfcode.domain;

import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Getter
@Setter
public class Question {
    /** */
    private Long id;

    /** 标题*/
    private String title;

    /** 类型(单选/多选/判断)*/
    private Integer type;

    /** 判断正确(针对判断题才有此项)*/
    private Boolean judgeRight;

    //分数
    private Integer score;

    //选项
    private List<QuestionItem> questionItems;

    //选择题答案
    public String getResult(){
        String str="";
        for (QuestionItem questionItem:this.questionItems){
            if (questionItem.getJudge_right()){
                str += questionItem.getTitle().substring(0,1);
            }
        }
        return str;
    }
}